package com.dyypdadmin.service.impl;

import com.dyypdadmin.dao.ServicecategoriesDao;
import com.dyypdadmin.pojo.Servicecategories;
import com.dyypdadmin.service.ServicecategoriesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ServicecategoriesServiceImpl implements ServicecategoriesService {

    @Autowired
    private ServicecategoriesDao servicecategoriesDao;

    @Override
    public int addServicecategories(Servicecategories servicecategories) {
        return servicecategoriesDao.insert(servicecategories);
    }

    @Override
    public int updateServicecategories(Servicecategories servicecategories) {
        return servicecategoriesDao.updateById(servicecategories);
    }

    @Override
    public int deleteServicecategoriesById(int service_id) {
        return servicecategoriesDao.deleteById(service_id);
    }

    @Override
    public Servicecategories getServicecategoriesById(int service_id) {
        return servicecategoriesDao.selectById(service_id);
    }

    @Override
    public List<Servicecategories> getAllServicecategories() {
        return servicecategoriesDao.getAllServicecategories();
    }
}
